<template><div><h2 id="升级指南" tabindex="-1"><a class="header-anchor" href="#升级指南"><span>升级指南</span></a></h2>
<ul>
<li><a href="#upgrade-10.0">从 9.x 升级到 10.0</a></li>
</ul>
<h2 id="高影响变化" tabindex="-1"><a class="header-anchor" href="#高影响变化"><span>高影响变化</span></a></h2>
<ul>
<li><a href="#updating-dependencies">更新依赖项</a></li>
<li><a href="#updating-minimum-stability">更新最小稳定性</a></li>
</ul>
<h2 id="中等影响变化" tabindex="-1"><a class="header-anchor" href="#中等影响变化"><span>中等影响变化</span></a></h2>
<ul>
<li><a href="#database-expressions">数据库表达式</a></li>
<li><a href="#model-dates-property">模型「日期」属性</a></li>
<li><a href="#monolog-3">Monolog 3</a></li>
<li><a href="#redis-cache-tags">Redis缓存标签</a></li>
<li><a href="#service-mocking">服务模拟</a></li>
<li><a href="#language-directory">语言目录</a></li>
</ul>
<h2 id="较小影响变化" tabindex="-1"><a class="header-anchor" href="#较小影响变化"><span>较小影响变化</span></a></h2>
<ul>
<li><a href="#closure-validation-rule-messages">Closure 验证规则消息</a></li>
<li><a href="#public-path-binding">Public 路径绑定</a></li>
<li><a href="#query-exception-constructor">Query 异常构造函数</a></li>
<li><a href="#rate-limiter-return-values">Rate Limiter 返回值</a></li>
<li><a href="#relation-getbasequery-method">关系 <code v-pre>getBaseQuery</code> 方法</a></li>
<li><a href="#redirect-home"><code v-pre>Redirect::home</code> 方法</a></li>
<li><a href="#dispatch-now"><code v-pre>Bus::dispatchNow</code> 方法</a></li>
<li><a href="#register-policies"><code v-pre>registerPolicies</code> 方法</a></li>
<li><a href="#ulid-columns">ULID 列</a></li>
</ul>
<h2 id="从-9-x-升级到-10-0" tabindex="-1"><a class="header-anchor" href="#从-9-x-升级到-10-0"><span>从 9.x 升级到 10.0</span></a></h2>
<h4 id="预计升级时间-10-分钟" tabindex="-1"><a class="header-anchor" href="#预计升级时间-10-分钟"><span>预计升级时间：10 分钟</span></a></h4>
<blockquote>
<p><strong>注意</strong><br>
我们试图记录每一个可能的破坏性变更。由于其中一些破坏性变更位于框架的底层部分，因此只有其中一部分变更实际上会影响你的应用程序。想节省时间吗？你可以使用 <a href="https://laravelshift.com/" target="_blank" rel="noopener noreferrer">Laravel Shift</a> 来帮助自动升级你的应用程序。</p>
</blockquote>
<h3 id="更新依赖项" tabindex="-1"><a class="header-anchor" href="#更新依赖项"><span>更新依赖项</span></a></h3>
<p><strong>影响可能性：高</strong></p>
<h4 id="要求-php-8-1-0" tabindex="-1"><a class="header-anchor" href="#要求-php-8-1-0"><span>要求 PHP 8.1.0</span></a></h4>
<p>Laravel 现在要求 PHP 8.1.0 或更高版本。</p>
<h4 id="要求-composer-2-2-0" tabindex="-1"><a class="header-anchor" href="#要求-composer-2-2-0"><span>要求 Composer 2.2.0</span></a></h4>
<p>Laravel 现在要求 <a href="https://getcomposer.org/" target="_blank" rel="noopener noreferrer">Composer</a> 2.2.0 或更高版本。</p>
<h4 id="更新-composer-依赖项" tabindex="-1"><a class="header-anchor" href="#更新-composer-依赖项"><span>更新 Composer 依赖项</span></a></h4>
<p>你应该在应用程序的 <code v-pre>composer.json</code> 文件中更新以下依赖项：</p>
<ul>
<li><code v-pre>laravel/framework</code> 更新到 <code v-pre>^10.0</code></li>
<li><code v-pre>laravel/sanctum</code> 更新到 <code v-pre>^3.2</code></li>
<li><code v-pre>doctrine/dbal</code> 更新到 <code v-pre>^3.0</code></li>
<li><code v-pre>spatie/laravel-ignition</code> 更新到 <code v-pre>^2.0</code></li>
</ul>
<p>如果你从 2.x 发布系列升级到 Sanctum 3.x，请参考 <a href="https://github.com/laravel/sanctum/blob/3.x/UPGRADE.md" target="_blank" rel="noopener noreferrer">Sanctum 升级指南</a>。</p>
<p>此外，如果你想使用 <a href="https://phpunit.de/announcements/phpunit-10.html" target="_blank" rel="noopener noreferrer">PHPUnit 10</a>，则应该从应用程序的 <code v-pre>phpunit.xml</code> 配置文件的 <code v-pre>&lt;coverage&gt;</code> 部分中删除 <code v-pre>processUncoveredFiles</code> 属性。然后，更新应用程序的 <code v-pre>composer.json</code> 文件中的以下依赖项：</p>
<ul>
<li><code v-pre>nunomaduro/collision</code> 更新到 <code v-pre>^7.0</code></li>
<li><code v-pre>phpunit/phpunit</code> 更新到 <code v-pre>^10.0</code></li>
</ul>
<p>最后，检查应用程序使用的任何其他第三方包，并验证你正在使用 Laravel 10 支持的适当版本。</p>
<h4 id="最小稳定性" tabindex="-1"><a class="header-anchor" href="#最小稳定性"><span>最小稳定性</span></a></h4>
<p>你应该将应用程序的 <code v-pre>composer.json</code> 文件中的 <code v-pre>minimum-stability</code> 设置更新为 <code v-pre>stable</code>：</p>
<div class="language-json line-numbers-mode" data-highlighter="prismjs" data-ext="json" data-title="json"><pre v-pre class="language-json"><code><span class="line"><span class="token property">"minimum-stability"</span><span class="token operator">:</span> <span class="token string">"stable"</span><span class="token punctuation">,</span></span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><h3 id="应用程序" tabindex="-1"><a class="header-anchor" href="#应用程序"><span>应用程序</span></a></h3>
<h4 id="绑定公共路径" tabindex="-1"><a class="header-anchor" href="#绑定公共路径"><span>绑定公共路径</span></a></h4>
<p><strong>影响可能性：低</strong></p>
<p>如果你的应用程序将通过 <code v-pre>path.public</code> 绑定到容器来自定义其「公共路径」，则应该更新你的代码以调用 <code v-pre>Illuminate\Foundation\Application</code> 对象提供的 <code v-pre>usePublicPath</code> 方法：</p>
<div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php" data-title="php"><pre v-pre class="language-php"><code><span class="line"><span class="token function">app</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">-></span><span class="token function">usePublicPath</span><span class="token punctuation">(</span><span class="token constant">__DIR__</span><span class="token operator">.</span><span class="token string single-quoted-string">'/public'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><h3 id="授权" tabindex="-1"><a class="header-anchor" href="#授权"><span>授权</span></a></h3>
<h3 id="registerpolicies-方法" tabindex="-1"><a class="header-anchor" href="#registerpolicies-方法"><span><code v-pre>registerPolicies</code> 方法</span></a></h3>
<p><strong>影响可能性：低</strong></p>
<p>框架会自动调用 <code v-pre>AuthServiceProvider</code> 的 <code v-pre>registerPolicies</code> 方法。因此，你可以从应用程序的 <code v-pre>AuthServiceProvider</code> 的 <code v-pre>boot</code> 方法中删除对此方法的调用。</p>
<h3 id="缓存" tabindex="-1"><a class="header-anchor" href="#缓存"><span>缓存</span></a></h3>
<h4 id="redis-缓存标签" tabindex="-1"><a class="header-anchor" href="#redis-缓存标签"><span>Redis 缓存标签</span></a></h4>
<p><strong>影响可能性：中等</strong></p>
<p>Redis 的 <a href="https://learnku.com/docs/laravel/10.x/cache#cache-tags" target="_blank" rel="noopener noreferrer">缓存标签</a> 支持已被重新编写，以提供更好的性能和存储效率。在 Laravel 之前的版本中，如果使用 Redis 作为应用程序的缓存驱动程序，则会在缓存中累积旧的缓存标签。</p>
<p>然而，为了正确地删除过时的缓存标记项，Laravel 新的 <code v-pre>cache:prune-stale-tags</code> Artisan 命令应该在你的应用程序的 <code v-pre>App\Console\Kernel</code> 类中 <a href="https://learnku.com/docs/laravel/10.x/scheduling" target="_blank" rel="noopener noreferrer">预定</a>：</p>
<div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php" data-title="php"><pre v-pre class="language-php"><code><span class="line"><span class="token variable">$schedule</span><span class="token operator">-></span><span class="token function">command</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'cache:prune-stale-tags'</span><span class="token punctuation">)</span><span class="token operator">-></span><span class="token function">hourly</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><h3 id="数据库" tabindex="-1"><a class="header-anchor" href="#数据库"><span>数据库</span></a></h3>
<h4 id="数据库表达式" tabindex="-1"><a class="header-anchor" href="#数据库表达式"><span>数据库表达式</span></a></h4>
<p><strong>影响可能性：中等</strong></p>
<p>Laravel 10.x 重新编写了数据库「表达式」（通常是通过 <code v-pre>DB::raw</code> 生成），以便在未来提供额外的功能。需要注意的是，语法的原始字符串值现在必须通过表达式的 <code v-pre>getValue(Grammar $grammar)</code> 方法检索。现在不再支持将表达式强制转换为字符串使用 <code v-pre>(string)</code> 。</p>
<p><strong>通常，这不会影响最终用户的应用程序</strong>；但是，如果你的应用程序正在手动将数据库表达式强制转换为字符串使用 <code v-pre>(string)</code> 或直接调用表达式的 <code v-pre>__toString</code> 方法，则应该更新你的代码以调用 <code v-pre>getValue</code> 方法：</p>
<div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php" data-title="php"><pre v-pre class="language-php"><code><span class="line"><span class="token keyword">use</span> <span class="token package">Illuminate<span class="token punctuation">\</span>Support<span class="token punctuation">\</span>Facades<span class="token punctuation">\</span>DB</span><span class="token punctuation">;</span></span>
<span class="line"></span>
<span class="line"><span class="token variable">$expression</span> <span class="token operator">=</span> <span class="token class-name static-context">DB</span><span class="token operator">::</span><span class="token function">raw</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'select 1'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="line"></span>
<span class="line"><span class="token variable">$string</span> <span class="token operator">=</span> <span class="token variable">$expression</span><span class="token operator">-></span><span class="token function">getValue</span><span class="token punctuation">(</span><span class="token class-name static-context">DB</span><span class="token operator">::</span><span class="token function">connection</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">-></span><span class="token function">getQueryGrammar</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h4 id="查询异常构造函数" tabindex="-1"><a class="header-anchor" href="#查询异常构造函数"><span>查询异常构造函数</span></a></h4>
<p><strong>影响可能性：非常低</strong></p>
<p><code v-pre>Illuminate\Database\QueryException</code> 构造函数现在接受一个字符串连接名称作为其第一个参数。如果你的应用程序正在手动抛出此异常，则应相应调整你的代码。</p>
<h4 id="ulid-列" tabindex="-1"><a class="header-anchor" href="#ulid-列"><span>ULID 列</span></a></h4>
<p><strong>影响可能性：低</strong></p>
<p>当迁移调用 <code v-pre>ulid</code> 方法而没有任何参数时，列现在将被命名为 <code v-pre>ulid</code>。在 Laravel 的以前版本中，调用此方法而没有任何参数会创建一个错误命名为 <code v-pre>uuid</code> 的列：</p>
<div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php" data-title="php"><pre v-pre class="language-php"><code><span class="line"><span class="token variable">$table</span><span class="token operator">-></span><span class="token function">ulid</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>在调用 <code v-pre>ulid</code> 方法时显式指定列名，可以将列名传递给该方法：</p>
<div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php" data-title="php"><pre v-pre class="language-php"><code><span class="line"><span class="token variable">$table</span><span class="token operator">-></span><span class="token function">ulid</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'ulid'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><h3 id="eloquent" tabindex="-1"><a class="header-anchor" href="#eloquent"><span>Eloquent</span></a></h3>
<h4 id="模型「dates」属性" tabindex="-1"><a class="header-anchor" href="#模型「dates」属性"><span>模型「Dates」属性</span></a></h4>
<p><strong>影响可能性：中等</strong></p>
<p>已删除 Eloquent 模型中已过时属性。现在，你的应用程序应该使用<code v-pre>$casts</code> 属性：</p>
<div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php" data-title="php"><pre v-pre class="language-php"><code><span class="line"><span class="token keyword">protected</span> <span class="token variable">$casts</span> <span class="token operator">=</span> <span class="token punctuation">[</span></span>
<span class="line">    <span class="token string single-quoted-string">'deployed_at'</span> <span class="token operator">=></span> <span class="token string single-quoted-string">'datetime'</span><span class="token punctuation">,</span></span>
<span class="line"><span class="token punctuation">]</span><span class="token punctuation">;</span></span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h4 id="关系-getbasequery-方法" tabindex="-1"><a class="header-anchor" href="#关系-getbasequery-方法"><span>关系 <code v-pre>getBaseQuery</code> 方法</span></a></h4>
<p><strong>影响可能性：非常低</strong></p>
<p>在 <code v-pre>Illuminate\Database\Eloquent\Relations\Relation</code> 类中的 <code v-pre>getBaseQuery</code> 方法已更名为 <code v-pre>toBase</code>。</p>
<h3 id="本地化" tabindex="-1"><a class="header-anchor" href="#本地化"><span>本地化</span></a></h3>
<h4 id="语言目录" tabindex="-1"><a class="header-anchor" href="#语言目录"><span>语言目录</span></a></h4>
<p><strong>影响可能性：无</strong></p>
<p>虽然不涉及现有应用程序，但 Laravel 应用程序骨架不再默认包含 <code v-pre>lang</code> 目录。相反，在编写新的 Laravel 应用程序时，可以使用 <code v-pre>lang:publish</code> Artisan 命令进行发布：</p>
<div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh" data-title="sh"><pre v-pre class="language-bash"><code><span class="line">php artisan lang:publish</span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><h3 id="日志" tabindex="-1"><a class="header-anchor" href="#日志"><span>日志</span></a></h3>
<h4 id="monolog-3" tabindex="-1"><a class="header-anchor" href="#monolog-3"><span>Monolog 3</span></a></h4>
<p><strong>影响可能性：中等</strong></p>
<p>Laravel 的 Monolog 依赖项已更新为 Monolog 3.x。如果你正在直接与 Monolog 交互，则应该查看 Monolog 的<a href="https://github.com/Seldaek/monolog/blob/main/UPGRADE." target="_blank" rel="noopener noreferrer">升级指南</a>。</p>
<p>如果你正在使用 BugSnag 或 Rollbar 等第三方日志记录服务，请确保将这些第三方包升级到支持 Monolog 3.x 和 Laravel 10.x 版本的版本。</p>
<h3 id="队列" tabindex="-1"><a class="header-anchor" href="#队列"><span>队列</span></a></h3>
<h4 id="bus-dispatchnow-方法" tabindex="-1"><a class="header-anchor" href="#bus-dispatchnow-方法"><span><code v-pre>Bus::dispatchNow</code> 方法</span></a></h4>
<p><strong>影响可能性：低</strong></p>
<p>已删除过时的 <code v-pre>Bus::dispatchNow</code> 和 <code v-pre>dispatch_now</code> 方法。目前你的应用程序应该分别使用 <code v-pre>Bus::dispatchSync</code> 和 <code v-pre>dispatch_sync</code> 方法。</p>
<h3 id="路由" tabindex="-1"><a class="header-anchor" href="#路由"><span>路由</span></a></h3>
<h4 id="中间件别名" tabindex="-1"><a class="header-anchor" href="#中间件别名"><span>中间件别名</span></a></h4>
<p><strong>影响可能性：非强制</strong></p>
<p>在新的 Laravel 应用程序中，<code v-pre>App\Http\Kernel</code> 类的 <code v-pre>$routeMiddleware</code> 属性已更名为 <code v-pre>$middlewareAliases</code>，以更好地反映其用途。你可以在现有应用程序中重命名此属性，但不是强制的。</p>
<h4 id="限速器返回值" tabindex="-1"><a class="header-anchor" href="#限速器返回值"><span>限速器返回值</span></a></h4>
<p><strong>影响可能性: 低</strong></p>
<p>调用 <code v-pre>RateLimiter::attempt</code> 方法时，该方法现在将返回由提供的闭包返回的值。如果没有返回任何值或返回 <code v-pre>null</code>，则 <code v-pre>attempt</code> 方法将返回 <code v-pre>true</code>：</p>
<div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php" data-title="php"><pre v-pre class="language-php"><code><span class="line"><span class="token variable">$value</span> <span class="token operator">=</span> <span class="token class-name static-context">RateLimiter</span><span class="token operator">::</span><span class="token function">attempt</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'key'</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token keyword">fn</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">[</span><span class="token string single-quoted-string">'example'</span><span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="line"></span>
<span class="line"><span class="token variable">$value</span><span class="token punctuation">;</span> <span class="token comment">// ['example']</span></span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h4 id="redirect-home-方法" tabindex="-1"><a class="header-anchor" href="#redirect-home-方法"><span><code v-pre>Redirect::home</code> 方法</span></a></h4>
<p><strong>影响可能性: 非常低</strong></p>
<p>已删除不推荐使用的 <code v-pre>Redirect::home</code> 方法。相反，你的应用程序应该重定向到一个明确命名的路由：</p>
<div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php" data-title="php"><pre v-pre class="language-php"><code><span class="line"><span class="token keyword">return</span> <span class="token class-name static-context">Redirect</span><span class="token operator">::</span><span class="token function">route</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'home'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><h3 id="测试" tabindex="-1"><a class="header-anchor" href="#测试"><span>测试</span></a></h3>
<h4 id="服务模拟" tabindex="-1"><a class="header-anchor" href="#服务模拟"><span>服务模拟</span></a></h4>
<p><strong>影响可能性: 中等</strong></p>
<p>已从框架中删除不推荐使用的 <code v-pre>MocksApplicationServices</code> 特性。该特性提供了类似于 <code v-pre>expectsEvents</code>、<code v-pre>expectsJobs</code> 和 <code v-pre>expectsNotifications</code> 这样的测试方法。</p>
<p>如果你的应用程序使用这些方法，我们建议你过渡到 <code v-pre>Event::fake</code>、<code v-pre>Bus::fake</code> 和 <code v-pre>Notification::fake</code>。你可以通过相应组件的文档了解有关模拟的更多信息。</p>
<h3 id="验证" tabindex="-1"><a class="header-anchor" href="#验证"><span>验证</span></a></h3>
<h4 id="闭包验证规则消息" tabindex="-1"><a class="header-anchor" href="#闭包验证规则消息"><span>闭包验证规则消息</span></a></h4>
<p><strong>影响可能性: 非常低</strong></p>
<p>当编写基于闭包的自定义验证规则时，调用 <code v-pre>$fail</code> 回调超过一次，现在会将消息附加到数组中，而不是覆盖先前的消息。通常，这不会影响你的应用程序。</p>
<p>此外，<code v-pre>$fail</code> 回调现在返回一个对象。如果你之前对验证闭包的返回类型进行了类型提示，这可能需要你更新你的类型提示：</p>
<div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php" data-title="php"><pre v-pre class="language-php"><code><span class="line"><span class="token keyword">public</span> <span class="token keyword">function</span> <span class="token function-definition function">rules</span><span class="token punctuation">(</span><span class="token punctuation">)</span></span>
<span class="line"><span class="token punctuation">{</span></span>
<span class="line">    <span class="token string single-quoted-string">'name'</span> <span class="token operator">=></span> <span class="token punctuation">[</span></span>
<span class="line">        <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token variable">$attribute</span><span class="token punctuation">,</span> <span class="token variable">$value</span><span class="token punctuation">,</span> <span class="token variable">$fail</span><span class="token punctuation">)</span> <span class="token punctuation">{</span></span>
<span class="line">            <span class="token variable">$fail</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'validation.translation.key'</span><span class="token punctuation">)</span><span class="token operator">-></span><span class="token function">translate</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="line">        <span class="token punctuation">}</span><span class="token punctuation">,</span></span>
<span class="line">    <span class="token punctuation">]</span><span class="token punctuation">,</span></span>
<span class="line"><span class="token punctuation">}</span></span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="其他" tabindex="-1"><a class="header-anchor" href="#其他"><span>其他</span></a></h3>
<p>我们还鼓励你查看 <code v-pre>laravel/laravel</code> <a href="https://github.com/laravel/laravel" target="_blank" rel="noopener noreferrer">GitHub 存储库</a> 中的更改。虽然这些更改中许多都不是必需的，但你可能希望将这些文件与你的应用程序保持同步。本次升级指南将覆盖部分更改，但其他的更改，例如对配置文件或注释的更改，不会被覆盖。</p>
<p>你可以使用 <a href="https://github.com/laravel/laravel/compare/9.x...10.x" target="_blank" rel="noopener noreferrer">GitHub 比较工具</a> 轻松查看更改，并选择哪些更新对你重要。但是，GitHub 比较工具显示的许多更改都是由于我们的组织采用了 PHP 本地类型。这些更改是向后兼容的，迁移到 Laravel 10 期间采用它们是可选的。</p>
<blockquote>
<p>本译文仅用于学习和交流目的，转载请务必注明文章译者、出处、和本文链接<br>
我们的翻译工作遵照 <a href="https://learnku.com/docs/guide/cc4.0/6589" target="_blank" rel="noopener noreferrer">CC 协议</a>，如果我们的工作有侵犯到您的权益，请及时联系我们。</p>
</blockquote>
<hr>
<blockquote>
<p>原文地址：<a href="https://learnku.com/docs/laravel/10.x/upgrade/14833" target="_blank" rel="noopener noreferrer">https://learnku.com/docs/laravel/10.x/up...</a></p>
<p>译文地址：<a href="https://learnku.com/docs/laravel/10.x/upgrade/14833" target="_blank" rel="noopener noreferrer">https://learnku.com/docs/laravel/10.x/up...</a></p>
</blockquote>
</div></template>


